//
//  MainTabBarViewController.m
//  Lmm_IOS
//
//  Created by 张哲炜 on 2018/9/14.
//  Copyright © 2018年 lmm. All rights reserved.
//

#import "MainTabBarViewController.h"

@interface MainTabBarViewController ()

@end

@implementation MainTabBarViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    NSMutableDictionary *tabbarAttrNormal =[NSMutableDictionary dictionary];
    [tabbarAttrNormal setObject:[UIColor grayColor] forKey:NSForegroundColorAttributeName];
    
    NSMutableDictionary *tabbarAttrSelected = [NSMutableDictionary dictionary];
    [tabbarAttrSelected setObject:[UIColor redColor] forKey:NSForegroundColorAttributeName];
    
    //第一页tabbar设置
    //初始化tabbar
    IndexViewController *indexView =[[IndexViewController alloc]init];
    
    UITabBarItem *indexBarItem =[[UITabBarItem alloc]init];
    [indexBarItem setTitle:@"抢购"];
    [indexBarItem setTitleTextAttributes:tabbarAttrNormal forState:(UIControlStateNormal)];
    [indexBarItem setTitleTextAttributes:tabbarAttrSelected forState:(UIControlStateSelected)];
    [indexBarItem setImage:[[UIImage imageNamed:@"activity"]
                            imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)]];
    [indexBarItem setSelectedImage:[[UIImage imageNamed:@"activity_press"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)]];
    indexView.tabBarItem =indexBarItem;
    
    
    StoreViewController * storeView =[[StoreViewController alloc]init];
    UITabBarItem *storeBarItem = [[UITabBarItem alloc]init];
    [storeBarItem setTitle:@"商场"];
    [storeBarItem setTitleTextAttributes:tabbarAttrNormal forState:(UIControlStateNormal)];
    [storeBarItem setTitleTextAttributes:tabbarAttrSelected forState:(UIControlStateSelected)];
    [storeBarItem setImage:[[UIImage imageNamed:@"point_mall"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)]];
    [storeBarItem setSelectedImage:[[UIImage imageNamed:@"point_mall_press"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)]];
    
    storeView.tabBarItem =storeBarItem;
    
    
    MyViewController * myView =[[MyViewController alloc]init];
    UITabBarItem * myBarItem =[[UITabBarItem alloc]init];
    [myBarItem setTitle:@"我的"];
    [myBarItem setTitleTextAttributes:tabbarAttrNormal forState:(UIControlStateNormal)];
    [myBarItem setTitleTextAttributes:tabbarAttrSelected forState:(UIControlStateSelected)];
    [myBarItem setImage:[[UIImage imageNamed:@"my"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)]];
    [myBarItem setSelectedImage:[[UIImage imageNamed:@"my_press"]imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)]];
    myView.tabBarItem =myBarItem;
    
    
    self.viewControllers = @[indexView,storeView,myView];
    
    // Do any additional setup after loading the view.
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
